import { ref, computed } from 'vue';
import { defineStore } from 'pinia';

export const useAuthStore = defineStore('auth', () => {
    const token = ref('');
    const getterToken = computed(() => token.value);
    const setterToken = (value: string) => {
        token.value = value;
        localStorage.setItem('APP_PERMISSION', value);
        sessionStorage.setItem('APP_PERMISSION', value);
        console.warn(localStorage.getItem('APP_PERMISSION'));
    };
    return {
        getterToken,
        setterToken
    };
});
